package com.itheima.d3_inner_class3;
/*
    1 匿名内部类在开发中的使用场景
        通常作为一个参数传输给方法。

 */
public class Test2 {
    public static void main(String[] args) {
        MaHu lv = new MaHu();
        swimGame(lv);
        swimGame(() -> System.out.println("狗会骑驴找猫"));
//        swimGame(() -> System.out.println("狗会骑驴找猫"));;'

    }
    public static void swimGame(Swimming s){
        s.swim();

    }

}


interface Swimming{
    void swim();
}

class MaHu implements Swimming{

    @Override
    public void swim() {
        System.out.println("驴会狗刨");
    }
}
